<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__PUBLIC__/admin/css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.js" ></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.form.js" ></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/formfiles.js" ></script>
<script type="text/javascript" src="__ROOT__/ckeds/ckeditor.js"></script>
<script type="text/javascript">
function check()
{
	if (document.form1.title.value.match(/^\s*$/)){
		alert ("标题名称不能为空");
		document.form1.title.focus();
		return false;
	}
}
var count=0;
$(function(){
	var strhtml="";	
	var num=1;
	$("#btn").click(function(){
		count=num++;
		strhtml='<div><input id="photo'+(count)+'" class="inputleft htinputcss" name="photo'+(count)+'" value="" type="text"><a class="files" href="javascript:void(0);"><input id="FileUpload'+(count)+'" onchange="SingleUpload(\'photo'+(count)+'\',\'FileUpload'+(count)+'\',\'images\',\'__URL__/upload\')" name="FileUpload'+(count)+'" type="file"></a><span class="uploading">正在上传，请稍候...</span><input type="button" value="删除" class="delbtn2" onclick="delimg(this)" />&nbsp;<span class="redziti">*</span><div class="imgh"></div></div>';
		$("#show").append(strhtml);
		$("#imgnum").val(count);
	});	
});

//删除图片
function delimg(btn){
	$("#imgnum").val(--count);
	$(btn).parent().remove();
}
//ajax删除图片
function deloldimg(getid,id){
	$.get("__URL__/delimg",{imgid:getid,pid:id},function(data){
		$('#showimg').html(data);
	});
}
</script>
</head>

<body>
<div id="spacemenu">
	<div id="leftarrow"></div>
    <div id="return1"><a href="__URL__?id={?$cid?}&page={?$page?}&kwords={?$kwords?}">返回上一级</a></div>
</div>
<div class="alterdiv"></div>
<div id="posdiv">
	<table width="94%" border="0" cellspacing="0" cellpadding="0" class="gray" align="center">
  <tr>
    <td height="46" class="linkblue">您当前的位置:<a href="__MODULE__/ColumnManage#{?$cid?}">栏目管理</a> &gt;&gt; {?$cname?} </td>
  </tr>
</table>
</div>
<div id="maindiv">
<form id="form1" name="form1" method="post" action="__ACTION__?id={?$id?}&cid={?$cid?}&action=mod&page={?$page?}" onsubmit="return check()">
<input name="imgnum" id="imgnum" type="hidden" value="1" />
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="green">
<tr>
    <td width="28%" height="40" align="right">所属栏目：</td>
    <td width="72%" colspan="2">{?$modselpcls?}</td>
  </tr>
  <tr>
    <td width="28%" height="40" align="right">标题：</td>
    <td width="72%" colspan="2"><input type="text" name="title" id="title" class="htinputcss" value="{?$data.title?}" />&nbsp;<font color="#FF0000">*</font></td>
  </tr>
  <tr>
    <td height="40" align="right">日期：</td>
    <td colspan="2"><input type="text" name="dates" id="dates" class="htinputcss" style="width:80px;" value="{?$data.dates?}" /></td>
  </tr>
  <tr>
    <td width="28%" height="40" align="right">型号：</td>
    <td width="72%" colspan="2"><input type="text" name="model" id="model" class="htinputcss" value="{?$data.model?}" />&nbsp;<font color="#FF0000">*</font></td>
  </tr>
  <tr>
  <td height="40" align="right">图片上传：</td>
  <td width="32%">
  <div id="showimg">
  	<volist name="imgs" id="vo">
      <input type="hidden" name="oldid[]" id="oldid[]" value="{?$vo.id?}">
      <div><input id="oldphoto{?$i?}" class="inputleft htinputcss" name="oldphoto{?$i?}" value="{?$vo.photo?}" type="text">
<a class="files" href="javascript:void(0);"><input id="oldFileUpload{?$i?}" onchange="SingleUpload('oldphoto{?$i?}','oldFileUpload{?$i?}','images','__URL__/upload')" name="oldFileUpload{?$i?}" type="file"></a><span class="uploading">正在上传，请稍候...</span><input type="button" value="删除" class="oldbtn delbtn2" onclick="deloldimg('{?$vo.id?}','{?$id?}')" />&nbsp;<span class="redziti">*</span>
      <div class="imgh"></div>
      </div>
      </volist>
      </div>
  <div id="show"></div>
  </td>
  <td valign="top"><input type="button" name="btn" id="btn" value="添加下一张" class="orderbtn" /></td>
  </tr>
  <tr>
    <td height="40" align="right">内容：</td>
    <td colspan="2"><textarea name="bodys" id="bodys" class="ckeditor" cols="45" rows="5">{?$bodys?}</textarea></td>
  </tr>
  <tr>
    <td height="40" align="right">&nbsp;</td>
    <td colspan="2"><input type="submit" name="button" id="button" value="修改" class="addbtn" />&nbsp;&nbsp;
      <input type="reset" name="button2" id="button2" value="重置" class="resbtn" /></td>
  </tr>
</table>
</form>
</div>
</body>
</html>
